home *** CD-ROM | disk | FTP | other *** search
/ IRIX Installation Tools & Overlays 2002 November / SGI IRIX Installation Tools & Overlays 2002 November - Disc 4.iso / dist / motif21_dev.idb / usr / Motif-2.1 / include / Xm / IconGP.h.z / IconGP.h
C/C++ Source or Header  |  2002-10-15  |  9KB  |  258 lines

  1. /* $XConsortium: IconGP.h /main/9 1995/10/25 20:06:59 cde-sun $ */
  2. /*
  3.  *  @OSF_COPYRIGHT@
  4.  *  COPYRIGHT NOTICE
  5.  *  Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
  6.  *  ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
  7.  *  the full copyright text.
  8.  */
  9. /*
  10.  * HISTORY
  11.  */
  12. #ifndef _XmIconGP_h
  13. #define _XmIconGP_h
  14.  
  15. #include <Xm/XmP.h>
  16. #include <Xm/ManagerP.h>
  17. #include <Xm/GadgetP.h>
  18. #include <Xm/IconG.h>
  19. #include <Xm/ExtObjectP.h>
  20.  
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24.  
  25. typedef Widget (*XmGetContainerParentProc)(Widget) ;
  26.  
  27. #define XmInheritGetContainerParentProc ((XmGetContainerParentProc) _XtInherit)
  28.  
  29.  
  30. /* IconGadget class record */
  31. typedef struct _XmIconGadgetClassPart
  32.     {
  33.     XmGetContainerParentProc    get_container_parent;
  34.     XtPointer extension ;
  35.  
  36. #ifdef _SGIMOTIF
  37.   XtPointer    _SG_vendorExtension;
  38. #endif
  39.     }     XmIconGadgetClassPart;
  40.  
  41.  
  42. /* Full class record declaration */
  43. typedef struct _XmIconGadgetClassRec
  44.     {
  45.     RectObjClassPart    rect_class;
  46.     XmGadgetClassPart    gadget_class;
  47.     XmIconGadgetClassPart    icong_class;
  48.     }     XmIconGadgetClassRec;
  49.  
  50. extern    XmIconGadgetClassRec     xmIconGadgetClassRec;
  51.  
  52. /*****************************************************************/
  53. /* The Icon Gadget Cache Object's class and instance records*/
  54. /*****************************************************************/
  55.  
  56. typedef struct _XmIconGCacheObjClassPart
  57. {
  58.     XtPointer extension;
  59. } XmIconGCacheObjClassPart;
  60.  
  61.  
  62. typedef struct _XmIconGCacheObjClassRec  /* Icon cache class record */
  63. {
  64.     ObjectClassPart                     object_class;
  65.     XmExtClassPart                      ext_class;
  66.     XmIconGCacheObjClassPart            icon_class_cache;
  67. } XmIconGCacheObjClassRec;
  68.  
  69. externalref XmIconGCacheObjClassRec xmIconGCacheObjClassRec;
  70.  
  71. /*  The Icon Gadget Cache instance record  */
  72.  
  73. typedef struct _XmIconGCacheObjPart
  74. {
  75.    XmRenderTable    render_table;        /* XmNrenderTable */
  76.    GC               selected_GC;
  77.    GC               inverse_GC;
  78.      
  79.    Pixel            background;
  80.    Pixel            foreground;
  81.    Pixel            top_shadow_color;
  82.    Pixel            bottom_shadow_color;
  83.    Pixel            highlight_color;
  84.  
  85.    Pixmap           background_pixmap;
  86.    Pixmap           top_shadow_pixmap;
  87.    Pixmap           bottom_shadow_pixmap;
  88.    Pixmap           highlight_pixmap;
  89.  
  90.    GC               normal_GC;
  91.    GC               background_GC;
  92.    GC               insensitive_GC;
  93.    GC               top_shadow_GC;
  94.    GC               bottom_shadow_GC;
  95.    GC               highlight_GC;
  96.   
  97.    unsigned char    alignment;
  98.    Dimension        spacing;
  99.    Dimension        margin_width;
  100.    Dimension        margin_height;
  101.  
  102. #ifdef _SGIMOTIF
  103.   XtPointer    _SG_vendorExtension;
  104. #endif
  105. } XmIconGCacheObjPart;
  106.  
  107. typedef struct _XmIconGCacheObjRec
  108. {
  109.   ObjectPart                object;
  110.   XmExtPart            ext;
  111.   XmIconGCacheObjPart       icon_cache;
  112. } XmIconGCacheObjRec;
  113.  
  114. typedef struct _XmIconGCacheObjRec   * XmIconGCacheObject;
  115.  
  116. /* IconGadget instance record */
  117. typedef struct _XmIconGadgetPart
  118.     {
  119.     XmString    label_string;        /* XmNlabelString */
  120.     Pixmap        large_icon_mask;    /* XmNlargeIconMask */
  121.     Pixmap        large_icon_pixmap;    /* XmNlargeIconPixmap */
  122.     Pixmap        small_icon_mask;    /* XmNsmallIconMask */
  123.     Pixmap        small_icon_pixmap;    /* XmNsmallIconPixmap */
  124.     unsigned char    viewtype;        /* XmNviewType */
  125.     unsigned char    visual_emphasis;    /* XmNvisualEmphasis */
  126.     XmString *    detail;                    /* XmNdetail */
  127.     Cardinal    detail_count;            /* XmNdetailCount */
  128.     /* Private variables */
  129.     Dimension    label_rect_width ;
  130.     Dimension    label_rect_height ;
  131.     Dimension    large_icon_rect_width;
  132.     Dimension    large_icon_rect_height;
  133.     Dimension    small_icon_rect_width;
  134.     Dimension    small_icon_rect_height;
  135.     String          large_pixmap_name ;
  136.     String          small_pixmap_name ;
  137.  
  138.     XmIconGCacheObjPart  *cache;
  139.        Boolean            check_set_render_table;
  140.  
  141. #ifdef _SGIMOTIF
  142.   XtPointer    _SG_vendorExtension;
  143. #endif
  144. } XmIconGadgetPart;
  145.  
  146. /* Full instance record declaration */
  147. typedef struct _XmIconGadgetRec
  148.     {
  149.     ObjectPart    object;
  150.     RectObjPart    rectangle;
  151.     XmGadgetPart    gadget;
  152.     XmIconGadgetPart icong;
  153.     }     XmIconGadgetRec;
  154.  
  155.  
  156. /* Useful macros */
  157. #define    IG_LabelString(w)    (((XmIconGadget)(w))->icong.label_string)
  158. #define    IG_LargeIconMask(w)    (((XmIconGadget)(w))->icong.large_icon_mask)
  159. #define    IG_LargeIconPixmap(w)    (((XmIconGadget)(w))->icong.large_icon_pixmap)
  160. #define    IG_SmallIconMask(w)    (((XmIconGadget)(w))->icong.small_icon_mask)
  161. #define IG_SmallIconPixmap(w)    (((XmIconGadget)(w))->icong.small_icon_pixmap)
  162. #define    IG_ViewType(w)        (((XmIconGadget)(w))->icong.viewtype)
  163. #define    IG_VisualEmphasis(w)    (((XmIconGadget)(w))->icong.visual_emphasis)
  164. #define    IG_Detail(w)            (((XmIconGadget)(w))->icong.detail)
  165. #define    IG_DetailCount(w)    (((XmIconGadget)(w))->icong.detail_count)
  166. #define    IG_LabelRectWidth(w)    (((XmIconGadget)(w))->icong.label_rect_width)
  167. #define    IG_LabelRectHeight(w)    (((XmIconGadget)(w))->icong.label_rect_height)
  168. #define    IG_LargeIconRectWidth(w) \
  169.                 (((XmIconGadget)(w))->icong.large_icon_rect_width)
  170. #define    IG_LargeIconRectHeight(w) \
  171.         (((XmIconGadget)(w))->icong.large_icon_rect_height)
  172. #define    IG_SmallIconRectWidth(w) \
  173.         (((XmIconGadget)(w))->icong.small_icon_rect_width)
  174. #define    IG_SmallIconRectHeight(w) \
  175.         (((XmIconGadget)(w))->icong.small_icon_rect_height)
  176. #define    IG_LargePixmapName(w) (((XmIconGadget)(w))->icong.large_pixmap_name)
  177. #define    IG_SmallPixmapName(w) (((XmIconGadget)(w))->icong.small_pixmap_name)
  178.  
  179. /* XmNrecomputeSize didn't make it as a resource, but since the
  180.    code is already written, I'll keep it and force its value here.
  181.    If it's ever wanted back, just replace that macro by:
  182.  #define IG_RecomputeSize(w)    (((XmIconGadget)(w))->icong.recompute_size) */
  183. #define    IG_RecomputeSize(w)    (True) 
  184.  
  185. #define    IG_LayoutDirection(w)    (((XmIconGadget)(w))->gadget.layout_direction)
  186. #define    IG_Highlighted(w)    (((XmIconGadget)(w))->gadget.highlighted)
  187. #define    IG_HLThickness(w)     (((XmIconGadget)(w))->gadget.highlight_thickness)
  188. #define    IG_ShadowThickness(w)    (((XmIconGadget)(w))->gadget.shadow_thickness)
  189. #define    IG_Depth(w)        (((XmManagerWidget) \
  190.                   (((XmGadget)(w))->object.parent))->core.depth)
  191.  
  192. /* cached resources for IconGadget */
  193. #define    IG_RenderTable(w)    (((XmIconGadget)(w))-> \
  194.                  icong.cache->render_table)
  195. #define    IG_SelectedGC(w)    (((XmIconGadget)(w))-> \
  196.                  icong.cache->selected_GC)
  197. #define    IG_InverseGC(w)            (((XmIconGadget)(w))-> \
  198.                  icong.cache->inverse_GC)
  199.  
  200. /** These are gadget resources really. hopefully in 2.1,
  201.     that will be replaced by stuff like:
  202.     #define    IG_Background(w)    Gad_Background(w)
  203.     #define    IG_BackgroundGC(w)  Gad_BackgroundGC(w)
  204.     etc, etc ***/
  205. #define    IG_Background(w)    (((XmIconGadget)(w))-> \
  206.                  icong.cache->background)
  207. #define    IG_Foreground(w)    (((XmIconGadget)(w))-> \
  208.                  icong.cache->foreground)
  209. #define    IG_TopShadowColor(w)    (((XmIconGadget)(w))-> \
  210.                  icong.cache->top_shadow_color)
  211. #define    IG_BottomShadowColor(w)    (((XmIconGadget)(w))-> \
  212.                  icong.cache->bottom_shadow_color)
  213. #define    IG_HighlightColor(w)    (((XmIconGadget)(w))-> \
  214.                  icong.cache->highlight_color)
  215.  
  216. #define    IG_BackgroundPixmap(w)    (((XmIconGadget)(w))-> \
  217.                  icong.cache->background_pixmap)
  218. #define    IG_TopShadowPixmap(w)    (((XmIconGadget)(w))-> \
  219.                  icong.cache->top_shadow_pixmap)
  220. #define    IG_BottomShadowPixmap(w)    (((XmIconGadget)(w))-> \
  221.                  icong.cache->bottom_shadow_pixmap)
  222. #define    IG_HighlightPixmap(w)    (((XmIconGadget)(w))-> \
  223.                  icong.cache->highlight_pixmap)
  224.  
  225. #define    IG_NormalGC(w)            (((XmIconGadget)(w))-> \
  226.                  icong.cache->normal_GC)
  227. #define    IG_BackgroundGC(w)    (((XmIconGadget)(w))-> \
  228.                  icong.cache->background_GC)
  229. #define    IG_InsensitiveGC(w)    (((XmIconGadget)(w))-> \
  230.                  icong.cache->insensitive_GC)
  231. #define    IG_TopShadowGC(w)    (((XmIconGadget)(w))-> \
  232.                  icong.cache->top_shadow_GC)
  233. #define    IG_BottomShadowGC(w)    (((XmIconGadget)(w))-> \
  234.                  icong.cache->bottom_shadow_GC)
  235. #define    IG_HighlightGC(w)    (((XmIconGadget)(w))-> \
  236.                  icong.cache->highlight_GC)
  237. #define    IG_Alignment(w)     (((XmIconGadget)(w))-> \
  238.                  icong.cache->alignment)
  239. #define    IG_Spacing(w)          (((XmIconGadget)(w))-> \
  240.                  icong.cache->spacing)
  241. #define    IG_MarginWidth(w)     (((XmIconGadget)(w))-> \
  242.                  icong.cache->margin_width)
  243. #define    IG_MarginHeight(w)     (((XmIconGadget)(w))-> \
  244.                  icong.cache->margin_height)
  245.  
  246.  
  247. /* Convenience Macros */
  248. #define IG_Cache(w)            (((XmIconGadget)(w))->icong.cache)
  249. #define IG_ClassCachePart(w)   (((XmIconGadgetClass)xmIconGadgetClass)->\
  250.                 gadget_class.cache_part)
  251.  
  252. #ifdef __cplusplus
  253. }  /* Close scope of 'extern "C"' declaration which encloses file. */
  254. #endif
  255.  
  256. #endif /* _XmIconGP_h */
  257. /* DON'T ADD ANYTHING AFTER THIS #endif */
  258.